package com.prik.command.products;

/**
 * 电扇
 **/
public class ElectricFan {

    /**
     * 位置标记，区分哪里的电扇
     */
    private String tag;

    private int speed;

    public static final int OFF = 0;
    public static final int LOW = 1;
    public static final int MEDIUM = 2;
    public static final int HIGH = 3;

    public ElectricFan(String tag) {
        this.tag = tag;
    }

    public void speedHigh() {
        speed = HIGH;
        System.out.println("the " + tag + " fan is on high speed");
    }

    public void speedMedium() {
        speed = MEDIUM;
        System.out.println("the " + tag + " fan is on medium speed");
    }

    public void speedLow() {
        speed = LOW;
        System.out.println("the " + tag + " fan is on low speed");
    }

    public void turnOff() {
        speed = OFF;
        System.out.println("the " + tag + " fan is off");
    }

    public int getSpeed() {
        return speed;
    }
}